package cn.wonderland.netflix.controller;

import cn.wonderland.netflix.domain.User;
import cn.wonderland.netflix.domain.UserTest;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Value("${server.port}")
    String port;

    @GetMapping("/{id}")
    public User getUser(@PathVariable("id") Long id) throws InterruptedException {
//        Thread.sleep(4000);
        return new User(id,"user---获取成功！","端口号是： " + port);
    }
}
